package com.auntvt.timo.jpax.core.dialect;

import com.auntvt.timo.jpax.core.dialect.exporter.DisableForeignKeyExporter;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.mapping.ForeignKey;
import org.hibernate.tool.schema.spi.Exporter;

/**
 * MySQL数据库方言：关闭外键生成，设置默认字符集为utf8
 *
 * @author 小懒虫
 * @date 2021/7/31
 */
public class DisableForeignKeyMySQL5Dialect extends MySQL5Dialect {

    private DisableForeignKeyExporter foreignKeyExporter = new DisableForeignKeyExporter(this);

    @Override
    public String getTableTypeString() {
        return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
    }

    @Override
    public Exporter<ForeignKey> getForeignKeyExporter() {
        return foreignKeyExporter;
    }
}
